<div class="form-row">
  <?php
    if ($type == CommonValues::$gTallyInType['key']['Supplier'])
        echo '<label for="tally_in_type" >PO Number:</label>';
    else if ($type== CommonValues::$gTallyInType['key']['Project'])
        echo '<label for="tally_in_type" >Project Number:</label>';
    else if ($type == CommonValues::$gTallyInType['key']['Production'])
        echo '<label for="tally_in_type" >Sale Number:</label>';
    else
        echo '<label for="tally_in_type" >DO Number:</label>';
  ?>
  <?
  if ( $type==CommonValues::$gTallyInType['key']['Project']   )
  {
  ?>
  <div class="content">

  <select name="tally_in[project_id]" id="tally_in_project_id" class="tally_in_project_id" >
      <?
      $c = new Criteria();
      $c->addDescendingOrderByColumn(ProjectPeer::SALENO);
      $projectList = ProjectPeer::doSelect($c);

      foreach ($projectList as $project)
      {
          $id = $project->getId();
          echo "<option value='$id'>";
          echo $project->getSaleno().":".$project->getName();
          echo "</option>";
      }
      ?>
  </select>

  </div>

  <?
  }else
  if ($type==CommonValues::$gTallyInType['key']['Production'])
  {
  ?>
    <div class="content">

  <select name="tally_in[tallyno]" id="tally_in_tallyno" class="tally_in_tallyno" >
      <?
      $c = new Criteria();
      $c->addDescendingOrderByColumn(ProjectPeer::SALENO);
      $projectList = ProjectPeer::doSelect($c);

      foreach ($projectList as $project)
      {
          $id = $project->getId();
          echo "<option value='$id'>";
          echo $project->getSaleno().":".$project->getName();
          echo "</option>";
      }
      ?>
  </select>

  </div>

  <?
  }
  else if ($type==CommonValues::$gTallyInType['key']['Supplier'])
  {
  ?>
    <div class="content">

  <select name="tally_in[tallyno]" id="tally_in_tallyno" class="tally_in_tallyno" >
      <?
      $c = new Criteria();
        $c->addDescendingOrderByColumn(POPeer::PONO);
        $c->add(POPeer::APPROVALSTATUS , CommonValues::$gMRApprovalStatus['key']['Approved']);
        $c->add(POPeer::RECEIVEDSTATUS , CommonValues::$gPOReceivedStatus['key']['Fully Received'], Criteria::NOT_EQUAL);
        $c->add(POPeer::RECEIVEDSTATUS , CommonValues::$gPOReceivedStatus['key']['Revised'], Criteria::NOT_EQUAL);
      $poList = POPeer::doSelect($c);

      foreach ($poList as $po)
      {
          $id = $po->getId();
          echo "<option value='$id'>";
          echo $po->getPono().":".$po->getSupplier();
          echo "</option>";
      }
      ?>
  </select>

  </div>

  <?
  } else
  {
  ?>
  <input type="text" name ="tally_in[tallyno]" id ="tally_in_tallyno" size="15" value="" >
  <?
  }
  ?>


</div>

